"use strict";
var dest = './app/public';
var jsDest = dest + '/js';
var cssDest = dest + '/css';
var src = './app/components/frontend';
var vendors = ['react', 'lodash', 'react-canvas', 'react-bootstrap', 'superagent'];
module.exports = {
  jsDest: jsDest,
  cssDest: cssDest,
  browserSync: { // Use browserSync as a client; Use nodemon start express and auto reload
    port: 7000,
    proxy: "http://localhost:3000",
    files: ["public/**", "route/**", "views/**"]
  },
  sass: {
    src: src + "/stylesheets/main.scss",
    dest: dest + '/css',
    settings: {
      indentedSyntax: false, // Enable .sass syntax!
      imagePath: 'images', // Used by the image-url helper
      errLogToConsole: true
    }
  },
  images: {
    src: src + "/images/**",
    dest: dest + "/images"
  },
  markup: {
    src: src + "/htdocs/**",
    dest: dest
  },
  iconFonts: {
    name: 'Gulp Starter Icons',
    src: src + '/icons/*.svg',
    dest: dest + '/fonts',
    sassDest: src + '/sass',
    template: './gulp/tasks/iconFont/template.sass.swig',
    sassOutputName: '_icons.sass',
    fontPath: 'fonts',
    className: 'icon',
    options: {
      fontName: 'Post-Creator-Icons',
      appendCodepoints: true,
      normalize: false
    }
  },
  browserify: {
    // A separate bundle will be generated for each
    // bundle config in the list below
    bundleConfigs: [{
      entries: src + '/converter-client.js',
      dest: jsDest + '/converter',
      outputName: 'converter-bundle.js',
      // Additional file extentions to make optional
      //extensions: ['.coffee', '.hbs'],
      // list of modules to make require-able externally
      //require: vendors,
      debug: true,
      external: vendors
      // See https://github.com/greypants/gulp-starter/issues/87 for note about
      // why this is 'backbone/node_modules/underscore' and not 'underscore'
    }, {
      entries: src + '/evaluation-client.js',
      dest: jsDest + '/evaluation',
      outputName: 'evaluation-bundle.js',
      //require: vendors,
      // list of externally available modules to exclude from the bundle
      external: vendors
    }, {
      entries: src + '/questionnaire-client.js',
      dest: jsDest + '/questionnaire',
      outputName: 'questionnaire-bundle.js',
      //require: vendors,
      // list of externally available modules to exclude from the bundle
      external: vendors
    }, {
      entries: src + '/admin-qlist-client.js',
      dest: jsDest + '/admin',
      outputName: 'qlist-bundle.js',
      //require: vendors,
      // list of externally available modules to exclude from the bundle
      external: vendors
    }, {
      entries: src + '/admin-qdetail-client.js',
      dest: jsDest + '/admin',
      outputName: 'qdetail-bundle.js',
      //require: vendors,
      // list of externally available modules to exclude from the bundle
      external: vendors
    }],
    vendor: [{
      entries: src + '/lib/vendor.js',
      dest: jsDest + '/lib',
      outputName: 'vendor.min.js',
      // list of externally available modules to exclude from the bundle
      require: vendors
    }]
  },
  production: {
    cssSrc: dest + '/css/*.css',
    cssDest: dest + '/css',
    jsSrc: jsDest + '/**/*.js',
    dest: jsDest + '/',
    vendorSrc: jsDest + '/lib/*.min.js',
    vendorDest: jsDest + '/lib'
  },
  copyFiles: {
    src: [src + '/lib/*.min.js', src + '/util/**/*.js', '!' + src + 'components/frontend/**/*-client.js'],
    dest: jsDest
  }
};
